/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.upf.grupE.utils;

import java.lang.Math;

/**
 *
 * @author xday666
 */
public class GeoFinder {

    float lato, latf, lono, lonf;
    float earthRadius = 6378400;

    /**
     *
     * @param lat
     * @param lon
     * @param radius
     */
    public GeoFinder(float lat, float lon, float radius) {

        double rad = (double) earthRadius * Math.cos((double) lat);
        double perim = 2 * Math.PI * rad;
        double incx = (double) radius / (perim / 360);
        double incy = (double) radius / (earthRadius/360);

        lato = (float) ((double) lat - incx);
        latf = (float) ((double) lat + incx);
        lono = (float) ((double) lon - incy);
        lonf = (float) ((double) lon + incy);
    }

    /**
     *
     * @return
     */
    public float getLatf() {
        return latf;
    }

    /**
     *
     * @return
     */
    public float getLato() {
        return lato;
    }

    /**
     *
     * @return
     */
    public float getLonf() {
        return lonf;
    }

    /**
     *
     * @return
     */
    public float getLono() {
        return lono;
    }


}
